﻿namespace LanSunERP
{
    using System;
    using System.ServiceModel;
    using System.Windows.Forms;
    using System.Diagnostics;
    using System.Collections.Generic;
    using System.Runtime.Serialization;
    using System.Collections;
    using System.Data;
    using System.Data.SqlClient;

    public class PropertyList:QueryCommand
    {
               public PropertyList() : base () { }
               public PropertyList(SqlCommand cmdSQL, DataTable dtRequest,string RequestJob)
         : base(cmdSQL, dtRequest,RequestJob) {  }
        public SqlCommand BuildCommand()
        {
           switch (RequestJob.Substring(6, 10))
            {
                //GoodsMasterKey

                case "0000":
                    break;
                case "1000":
                    cmdSQL.Parameters.Add(new SqlParameter("@SysID", dwRequest["SysID"].ToString()));
                    cmdSQL.Parameters.Add(new SqlParameter("@GoodsType", dwRequest["GoodsType"].ToString()));
                    cmdSQL.Parameters.Add(new SqlParameter("@GoodsTypeKeyDefID", dwRequest["GoodsTypeKeyDefID"].ToString()));
                    cmdSQL.Parameters.Add(new SqlParameter("@GoodsKeyLevel", dwRequest["GoodsKeyLevel"].ToString()));
                    cmdSQL.Parameters.Add(new SqlParameter("@GoodsKeyID", dwRequest["GoodsKeyID"].ToString()));
                    break;
                case "1001":
                    cmdSQL.Parameters.Add(new SqlParameter("@SysID", dwRequest["SysID"].ToString()));
                    break;
                case "2000":
                case "3000":
                    cmdSQL.Parameters.Add(new SqlParameter("@SysID", dwRequest["SysID"].ToString()));
                    cmdSQL.Parameters.Add(new SqlParameter("@GoodsType", dwRequest["GoodsType"].ToString()));
                    cmdSQL.Parameters.Add(new SqlParameter("@GoodsTypeKeyDefID", dwRequest["GoodsTypeKeyDefID"].ToString()));
                    cmdSQL.Parameters.Add(new SqlParameter("@GoodsKeyLevel", dwRequest["GoodsKeyLevel"].ToString()));
                    cmdSQL.Parameters.Add(new SqlParameter("@GoodsKeyID", dwRequest["GoodsKeyID"].ToString()));
                    cmdSQL.Parameters.Add(new SqlParameter("@InstanceID", dwRequest["InstanceID"].ToString()));
                    cmdSQL = BuildInstanceKey(cmdSQL, dwRequest);
                    cmdSQL.Parameters.Add(new SqlParameter("@InstanceType", dwRequest["InstanceType"].ToString()));
                    cmdSQL.Parameters.Add(new SqlParameter("@PropertyGroupID", dwRequest["PropertyGroupID"].ToString()));
                    cmdSQL.Parameters.Add(new SqlParameter("@PropertyListID", dwRequest["PropertyListID"].ToString()));
                    cmdSQL.Parameters.Add(new SqlParameter("@PRLValue01", dwRequest["PRLValue01"].ToString()));
                    cmdSQL.Parameters.Add(new SqlParameter("@PRLValue02", dwRequest["PRLValue02"].ToString()));
                    cmdSQL.Parameters.Add(new SqlParameter("@PRLValue03", dwRequest["PRLValue03"].ToString()));
                    cmdSQL.Parameters.Add(new SqlParameter("@PRLValue04", dwRequest["PRLValue04"].ToString()));
                    cmdSQL.Parameters.Add(new SqlParameter("@PRLValue05", dwRequest["PRLValue05"].ToString()));
                    cmdSQL.Parameters.Add(new SqlParameter("@PRLValue06", dwRequest["PRLValue06"].ToString()));
                    cmdSQL.Parameters.Add(new SqlParameter("@PRLValue07", dwRequest["PRLValue07"].ToString()));
                    cmdSQL.Parameters.Add(new SqlParameter("@PRLValue08", dwRequest["PRLValue08"].ToString()));
                    cmdSQL.Parameters.Add(new SqlParameter("@PRLValue09", dwRequest["PRLValue09"].ToString()));
                    cmdSQL.Parameters.Add(new SqlParameter("@PRLValue10", dwRequest["PRLValue10"].ToString()));
                    cmdSQL.Parameters.Add(new SqlParameter("@PRLValue11", dwRequest["PRLValue11"].ToString()));
                    cmdSQL.Parameters.Add(new SqlParameter("@PRLValue12", dwRequest["PRLValue12"].ToString()));
                    cmdSQL.Parameters.Add(new SqlParameter("@PRLValue13", dwRequest["PRLValue13"].ToString()));
                    cmdSQL.Parameters.Add(new SqlParameter("@PRLValue14", dwRequest["PRLValue14"].ToString()));
                    cmdSQL.Parameters.Add(new SqlParameter("@PRLValue15", dwRequest["PRLValue15"].ToString()));
                    cmdSQL.Parameters.Add(new SqlParameter("@PRLValue16", dwRequest["PRLValue16"].ToString()));
                    cmdSQL.Parameters.Add(new SqlParameter("@PRLValue17", dwRequest["PRLValue17"].ToString()));
                    cmdSQL.Parameters.Add(new SqlParameter("@PRLValue18", dwRequest["PRLValue18"].ToString()));
                    cmdSQL.Parameters.Add(new SqlParameter("@PRLValue19", dwRequest["PRLValue19"].ToString()));
                    cmdSQL.Parameters.Add(new SqlParameter("@PRLValue20", dwRequest["PRLValue20"].ToString()));
                    cmdSQL.Parameters.Add(new SqlParameter("@SubStatus", dwRequest["SubStatus"].ToString()));
                    cmdSQL.Parameters.Add(new SqlParameter("@Status", dwRequest["Status"].ToString()));
                    
                    break;
                case "2001":case "4000":
                    cmdSQL.Parameters.Add(new SqlParameter("@InstanceID", dwRequest["InstanceID"].ToString())); 
                    break;
            }
             return cmdSQL;

        }      

    }
}